﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package mochicrypt.as3 {

    public class MochiEventDispatcher {

        private var eventTable:Object;

        public function MochiEventDispatcher():void{
            this.eventTable = {};
        }
        public function triggerEvent(_arg1:String, _arg2:Object):void{
            var _local3:Object;
            if (this.eventTable[_arg1] == undefined){
                return;
            };
            for (_local3 in this.eventTable[_arg1]) {
                var _local6 = this.eventTable[_arg1];
                _local6[_local3](_arg2);
            };
        }
        public function removeEventListener(_arg1:String, _arg2:Function):void{
            var _local3:Object;
            if (this.eventTable[_arg1] == undefined){
                this.eventTable[_arg1] = [];
                return;
            };
            for (_local3 in this.eventTable[_arg1]) {
                if (this.eventTable[_arg1][_local3] != _arg2){
                } else {
                    this.eventTable[_arg1].splice(Number(_local3), 1);
                };
            };
        }
        public function addEventListener(_arg1:String, _arg2:Function):void{
            this.removeEventListener(_arg1, _arg2);
            this.eventTable[_arg1].push(_arg2);
        }

    }
}//package mochicrypt.as3 
